//<{$lang.search}>
var paginationTotal = 1;//记录总数
var isSearch = false;
function submitsearchputaway() {
    isSearch = true;
    paginationCurrentPage = 1;
    initData(0);
}
$(function () {
    $(".searchputaway").click(function () {
        var putawayno = $("[name=putawayNo]").val();
        var dateFrom = $("[name=dateFrom]").val();
        var dateTo = $("[name=dateTo]").val();
        var receivingNo = $("[name=receivingNo]").val();
        if (putawayno == '' && ( dateFrom == '' && dateTo == '') && receivingNo=='') {
            alertTip('<{$lang.pls_input}><{$lang.search}><{$lang.content}>!');
            return;
        }
        if (dateFrom != '' && dateTo != '') {
            submitsearchputaway();
            return;
        } else if (putawayno == ''&& receivingNo=='') {
            alertTip('<{$lang.date}><{$lang.can_not_be_empty}>');
            return;
        }
        submitsearchputaway();
    });
    $('#dateFrom,#dateTo').datepicker({
        changeMonth:true,
        changeYear:true,
        dateFormat:'yy-mm-dd'
    });
    $('#dateFrom,#dateTo').val('');
});
function onblurputaway(obj) {
    var val=$(obj).val();
    if ($(obj).val() != '') {
        $('#dateFrom,#dateTo').val('');
        $("[name=putawayNo],[name=receivingNo]").val('');
        $(obj).val(val);
    }else{
        $('#dateFrom,#dateTo').val(getdate());
    }
}
function getdate() {
    var date = new Date();
    var now = "";
    now = date.getFullYear() + "-";
    now = now + (date.getMonth() + 1) + "-";
    now = now + date.getDate() + " ";
    return now;
}
